package com.example.statistics.ui.port

import com.example.statistics.bean.DefineInputBean
import com.example.statistics.bean.ExchangeRate
import com.example.statistics.common.BaseInputActivity
import com.example.statistics.net.UrlConfig
import com.example.statistics.utils.Constants
import com.example.statistics.weight.TextProcessingView

/**
 * 汇率新增
 */
class ExchangeRateEditActivity : BaseInputActivity<ExchangeRate>() {

    var date: String = ""

    override val title: String
        get() = "海关汇率"

    override val url: String
        get() = UrlConfig.PURCHASE_RATE_ADD

    override val inputDataList: List<DefineInputBean>
        get() = listOf(
            DefineInputBean("日期：", "date", TextProcessingView.STYLE_DISPLAY, labelValue = date),
            DefineInputBean("美元：", "dollar", TextProcessingView.STYLE_INPUT_FLOAT, defaultDecimalPoint = 4, isNull = false),
            DefineInputBean("欧元：", "euro", TextProcessingView.STYLE_INPUT_FLOAT, defaultDecimalPoint = 4, isNull = false)
        )


    override fun initialize() {
        super.initialize()
        date = intent.getStringExtra(Constants.DATE).orEmpty()
    }


/* mutableListOf(
            DefineInputBean(
                labelText = "11", labelKey = "m", style = TextProcessingView.STYLE_SELECTOR_JUMPS, isDefaultText = false,
                jumps = Pair(CarListActivity::class.java) { str, list ->
                    val carInfo = Gson().fromJson(str, CarInfoBean::class.java)
                    this.contentText = carInfo.plateNumber
                    list["a"]?.contentText = carInfo.salesArea
                    list["b"]?.contentText = carInfo.driverPhone

                },
            ),
            DefineInputBean(
                labelText = "11", labelKey = "i", style = TextProcessingView.STYLE_REFRESH,
                symbolAction = {
                    setRefreshStart()
                    setRefreshStop()
                },
                *//*jumps = Pair(CarListActivity::class.java) { str, list ->
                     val carInfo = Gson().fromJson(str, CarInfoBean::class.java)
                     this.contentText = carInfo.plateNumber
                     list["a"]?.contentText = carInfo.salesArea
                     list["b"]?.contentText = carInfo.driverPhone
                 },*//*
            ),
            DefineInputBean(labelText = "11", labelKey = "h", style = TextProcessingView.STYLE_INPUT, unitText = "件",
                symbolAction = {
                    singleDialog("S", "T", "V") {
                        this.contentText = it
                    }
                }),
            DefineInputBean(labelText = "11", labelKey = "a", style = TextProcessingView.STYLE_SEARCH,
                jumps = Pair(CarListActivity::class.java) { str, list ->
                    val carInfo = Gson().fromJson(str, CarInfoBean::class.java)
                    this.contentText = carInfo.plateNumber
                    list["a"]?.contentText = carInfo.salesArea
                    list["b"]?.contentText = carInfo.driverPhone
                }
            ),
            DefineInputBean(
                labelText = "11", labelKey = "b", style = TextProcessingView.STYLE_SELECTOR,
                singleDialogT = Pair(listOf<Bank>(Bank(bank = "111"), Bank(bank = "111"))) { str, list ->

                },
            ),
            DefineInputBean(
                labelText = "11", labelKey = "j", style = TextProcessingView.STYLE_SELECTOR,
                singleDialog = Pair(listOf("222", "333")) { str, list ->

                },
            ),
            DefineInputBean(labelText = "11", labelKey = "c", style = 6,
                symbolAction = {
                    setRefreshStart()
                    setRefreshStop()
                }),
            DefineInputBean(labelText = "11", labelKey = "d", style = 5,
                symbolAction = {
                    setRefreshStart()
                    setRefreshStop()
                }),
            DefineInputBean(labelText = "11", labelKey = "e", style = 2),
            DefineInputBean(labelText = "11", labelKey = "f", style = 1),
            DefineInputBean(labelText = "11", labelKey = "g", style = 0)
        )*/

}